1. Field of the Invention
The present invention relates generally to a method and system for performing synchronization between nodes in a wireless communication system, and more particularly, to a method and system for performing time synchronization between nodes in a wireless communication system.
2. Description of the Related Art
Ubiquitous networking, which has recently been attracting public attention, has also been increasingly intellectual and autonomous and has created new ubiquitous services over networks, including business activity services related to production and distribution, welfare services regarding medical care and medical treatment, and environmental services. Due to these advances, ubiquitous networking has come into the spotlight as a technology increasing the comfort of human lives.
In implementations of ubiquitous networking, synchronization should be performed between timers provided in nodes in order for the nodes to perform a predetermined operation at a scheduled time. Further, time synchronization is performed between two communication nodes that wirelessly communicate with each other.
According to basic principles of performing synchronization between nodes, a node (hereinafter referred to as a “reference node”), which is a basis or source of the synchronization, informs other nodes (hereinafter referred to as “correspondent nodes”) of a time of a timer of the reference node, so that each of the correspondent nodes may match its own correspondent node time to the time of the reference node. A time delay occurs in the synchronization process where the reference node reads a time from its timer, records the time in a packet and transmits the packet to inform other nodes of the time, and then a correspondent node receives this packet and reads the time recorded in the received packet. Assuming that a time delay occurring in the process where the reference node reads its own timer at a time T and transmits a packet with the time T included therein to a correspondent node, and the correspondent node receives the packet and reads the time T from the received packet is defined as D, since the time the correspondent node reads the time T is T+D, the correspondent node should match its time not to T, but to T+D. Therefore, for exact synchronization between the reference node and the correspondent node, it is necessary to know a value of the D. Two methods for finding this delay value are described as follows.
In a first method used in accordance with Institute of Electrical and Electronics Engineers (IEEE) 802.11, which is one of a plurality of typical wireless network standards, a delay time occurring in a reference node and a correspondent node is measured in advance of manufacture. The first method further includes compensating the measured value and reading/writing the compensated value during packet transmission/reception between the reference node and the correspondent node. Since the delay time must be measured by a hardware maker and then input into the hardware, this method cannot be used if the hardware does not support this function.
A second method includes measuring packet transmission/reception times between a reference node and a correspondent node, and then determining a delay time through calculation. More specifically, if a reference node records a transmission time in a packet and transmits the packet to a correspondent node, the correspondent node receives the packet and subtracts the transmission time written in the packet from a reception time of the packet, thereby finding a difference between the two times. The difference between the two times includes both a time taken for the transmission of the packet and a time difference between timers in the reference node and the correspondent nodes. As to the time difference between timers, its sign (+ or −) is determined according to whichever node has a faster time. By contrast, if a correspondent node records a transmission time in a packet and transmits the packet to a reference node, the reference node calculates a difference between a reception time and the transmission time of the packet. Similarly, the calculated time difference includes both a transmission delay time of the packet and a time difference between the two nodes, and a sign of the time difference is opposite to that of the time difference, which is determined above. Therefore, the inter-node time difference is cancelled out by adding the calculated two time differences and dividing the added time by 2, thereby making it possible to find a physical delay time. Further, by subtracting the two time differences from each other and dividing the subtracted time by 2, it is possible to determine, according to a sign (‘+’ or ‘−’) of the subtracted time differences, which one of the two nodes is faster than the other one of the two nodes. Accordingly, the correspondent node can set its time equal to the time of the reference node by subtracting or adding the time difference between the two nodes from/to the timer of the correspondent node. The time difference between two nodes will be referred to herein as an “offset.”
The first above-described method of measuring a delay time in advance and inputting the measured delay time in the hardware during hardware manufacturing cannot be used in a communication system that does not support this method, such as IEEE 802.15.4, since the hardware must support this function. Therefore, when such a method cannot be used, the second method can be used that corrects timers by calculating a time difference between timers in two nodes based on the transmission/reception time difference of a packet.
A conventional method of correcting timers by calculating a time difference between timers in transmission and reception nodes, i.e., a method of performing time synchronization between nodes is described as follows with reference to FIG. 1. FIG. 1 illustrates a process of performing time synchronization between nodes in a general wireless communication system.
Throughout this specification, Treference denotes a time that a timer in a reference node (or a transmitting node) indicates at a particular time, and Tcorrespondent denotes a time that a timer in a correspondent node (or a receiving node), which is a target of the synchronization, indicates at a particular time.
Inter-node synchronization starts in step 101. Then, a reference node 100 reads the current time of the reference node 100 in step 103. The current time of the reference node 100 is defined as a time that a timer in the reference node 100 indicates at a time s1, and is defined as Treference(s1). The reference node 100 records the Treference(s1) in a packet in step 105, records the packet with Treference(s1) recorded therein in a hardware transmission buffer in step 107, and transmits the recorded packet to a correspondent node 120 using Carrier Sense Multiple Access (CSMA) in step 109.
Upon receiving the packet, the correspondent node 120 reads a reception time of the packet with Treference(s1) recorded therein. The reception time of the packet with Treference(s1) recorded therein is defined as a time that a timer in the correspondent node 120 indicates at a time r1, and is defined as Tcorrespondent(r1). The correspondent node 120 can find an offset value using the Tcorrespondent(r1) and the Treference(s1). The offset value is a time difference between a time of the correspondent node 120 a time of the reference node 100, and can be expressed as Equation (1) below.Offset=Tcorrespondent(r1)−Treference(r1)  (1)
A time delay from the time that the transmission time of the packet was read by the reference node 100 until the time that the reception time of the packet was read by the correspondent node 120 is defined as Dforward, and it can be expressed as shown in Equation (2) below.Dforward=Treference(r1)−Treference(s1)  (2)
Equation (3) below can be obtained by adding Equation (1) to Equation (2).Offset+Dforward=Tcorrespondent(r1)−Treference(s1)  (3)
Because Tcorrespondent(r1) is a value read by the timer in the correspondent node 120 and Treference(s1) is a value recorded in the received packet, the correspondent node 120 can obtain Equation (4) below. Herein, a value of the Dforward to which the offset value is added is defined as a forward delay time, which is denoted by F in Equation (4) below.F=Offset+Dforward  (4)
After step 121, a process of finding a reverse delay time from the correspondent node 120 to the reference node 100, which corresponds to the operation of finding the forward delay time, is performed.
The correspondent node 120 reads the current time in step 121. The current time of the correspondent node 120 is defined as a time that a timer in the correspondent node 120 indicates at a time s2, and is defined as Tcorrespondent(s2). The correspondent node 120 records the Tcorrespondent(s2) and the forward delay time F in a packet in step 123, and records the packet with the Tcorrespondent(s2) and the F recorded therein in a hardware transmission buffer in step 125. The correspondent node 120 performs CSMA backoff in step 127, and transmits the packet with the Tcorrespondent(s2) and the F recorded therein to the reference node 100 in step 129.
Thereafter, the reference node 100 can obtain Dreverse of Equation (5) below by applying the same operation as the operation of finding the forward delay time. A time delay from the time that the transmission time of the packet was read by the correspondent node 120 till the time that the reception time of the packet was read by the reference node 100 is defined as Dreverse, and it can be expressed as Equation (5). Herein, a value of the Dreverse to which a negative value of the offset value is defined as a reverse delay time, which is denoted by R in Equation (6) below.Dreverse=Treference(r2)−Treference(s2)  (5)
Equation (6) below can be obtained using Equation (5) as follows.R=−Offset+Dreverse  (6)
If the forward delay time and the reverse delay time, delays in both directions, are equal, the offset is calculated using Equation (7) below.Offset=(F−R)/2  (7)
Therefore, the reference node 100 can calculate the offset value using Equation (7). If the reference node 100 informs the correspondent node 120 of the calculated offset value, the correspondent node 120 can determine the correct time of the reference node 100.
However, the bidirectional delays between the reference node and the correspondent node may not be equal. That is, the Dforward and the Dreverse may not be identical. This may not only result from a hardware difference between the reference node and the correspondent node, but may also occur, because if an interrupt occurs in a period after the reference node and the correspondent node read their current times and before packets are recorded in their hardware transmission buffers, a delay may occur to handle the interrupt. Although the latter case, may not occur frequently, this case does result in increasing synchronization errors.
In some cases, the bidirectional delays may not be identical due to random backoff that is performed before transmission start of a packet. CSMA is a typical media access scheme that is used in an asynchronized wireless network. Such CSMA uses a method of waiting for a random time and monitoring whether a medium is in use before packet transmission, in order to reduce transmission failures which may occur as different nodes simultaneously transmit packets. The operation of waiting for a random time is called “random backoff,” and this time is different in every transmission of a packet, causing a change in the bidirectional delays.
Time Division Multiple Access (TDMA) can also be used in wireless networks, and TDMA may further be used, not before, but after synchronization between nodes has been performed. This problem may be solved by performing the time recording after completing a backoff, instead of before the backoff. If a node performs another operation without transmitting a packet immediately after the backoff, a medium that has been empty may change back to an in-use state, causing transmission failure. Therefore, if various types of nodes coexist in the network, a synchronization error may inevitably increase.
In addition to the above-described problems of the conventional methods for time synchronization, every node may have a minute difference in clock frequency of the timer. An error of a clock frequency is called a clock drift. Because of the clock drift, even when synchronization has already been performed once between a reference node and a correspondent node, a time difference may occur again between the reference node and the correspondent node with the passage of time. Since the time difference is very minute but increases a small amount at a time, as time goes by, it becomes necessary to perform a synchronization operation at stated periods in order to maintain a synchronization error below a predetermined level. As a required error limit is lower, synchronization must be performed more frequently, which increases consumption of bandwidth and energy.